Trigger release workflow on tag push - #59
Merged
Merged
Conversation
The Release workflow only ran on workflow_dispatch, so cutting a release required clicking through the Actions UI. Now pushing a v-prefixed tag fires the workflow end-to-end: build, pack, dotnet nuget push, and a matching GitHub Release with notes extracted from CHANGELOG.md. - Add `push: tags: ['v*']` trigger; keep `workflow_dispatch` as fallback. - Add a `github-release` job (only runs on tag pushes) that extracts the `## [<version>]` section of CHANGELOG.md via awk and calls `gh release create` with the .nupkg attached. Fails loudly if no matching CHANGELOG section exists, so a forgotten Unreleased->[X.Y.Z] bump can't ship a blank release. - Update CONTRIBUTING.md "Cutting a release" to document the tag-push flow and explain that workflow_dispatch is now a fallback. NUGET_APIKEY is unchanged. The GH-release step uses the default GITHUB_TOKEN with explicit `permissions: contents: write`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
release.ymlnow fires onpush: tags: ['v*'](withworkflow_dispatchkept as a manual fallback)github-releasejob extracts the## [<version>]section ofCHANGELOG.mdand callsgh release createwith the.nupkgattached. Fails loudly if no matching CHANGELOG section exists, so a forgotten[Unreleased]→[X.Y.Z]bump can't ship a blank release.CONTRIBUTING.md"Cutting a release" updated to describe the tag-push flow.Why
Until now the release workflow was manual-only. Combined with merges accumulating in
[Unreleased], a full release's worth of work has been sitting un-tagged. After this lands, the v1.1.0 release is justgit tag -a v1.1.0 && git push --tags.NUGET_APIKEYis unchanged. The new GH-release step uses the defaultGITHUB_TOKENwith explicitpermissions: contents: write. No new secrets needed.Test plan
workflow_dispatchon this branch confirmsdotnet packstill works (run via GitHub UI after merge to main, or push a throwawayv1.1.0-rc1tag)v1.1.0and confirm: NuGet publish succeeds, GitHub Release is created with notes from CHANGELOG, .nupkg attached